home *** CD-ROM | disk | FTP | other *** search
-
- //construct login batch file name .......
- strcpy(linbuf, STARTUP_DIR);
- strcat(linbuf, users[i].name );
- strcat(linbuf, ".bat" );
-
- //find and run login script file .......
- if( ( fp = fopen(linbuf, "r")) == NULL )
- cprintf("Can't find user file %s\a\r\n",linbuf );
- else {
- char *comspec;
- fclose(fp) ;
- //overlay with command.com and run user batch ......
-
- if( (comspec = getenv("COMSPEC")) == NULL )
- exit(cprintf("No COMSPEC in environment\r\n"));
-
- if(execlp(comspec,comspec,"/C",linbuf,NULL) == -1)
- cprintf("Can't execute user file %s\a\r\n", linbuf);
-
- }
-
-